package wps.mojo.xmlaccess;

import java.io.File;
import java.util.Properties;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
import org.codehaus.plexus.resource.ResourceManager;

/**
 * @Author : <a href="mailto:Juanyong.zhang@carefirst.com">Cham
 *         Juanyong.zhang</a>
 * @Date : Apr 13, 2011
 */
public abstract class AbstractWpsMojo extends AbstractMojo {
	/**
	 * The working directory.
	 * 
	 * @parameter expression="${project.build.directory}/wps-plugin"
	 * @required
	 */
	protected File workingDirectory;

	/**
	 * The base directory.
	 * 
	 * @parameter expression="${project.basedir}"
	 * @required
	 */
	protected File basedir;

	/**
	 * @parameter default-value="${settings}"
	 * @required
	 * @readonly
	 */
	protected Settings settings;

	/**
	 * Working directory for plugin.
	 * 
	 * @parameter expression="${project.build.directory}"
	 * @required
	 */
	protected File buildDirectory;

	/**
	 * Maven Project.
	 * 
	 * @parameter expression="${project}"
	 * @required
	 */
	protected MavenProject project;

	/**
	 * @component
	 * @required
	 * @readonly
	 */
	protected ResourceManager resourceManager;

	protected Object getProperty(String key) {
		return project.getProperties().get(key);
	}

	protected void setProperty(Object key, Object value) {
		project.getProperties().put(key, value);
	}

	protected Properties getProperties() {
		return project.getProperties();
	}
}
